home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / UTIL / ProcessWatcher 3.0 ト.sit / ProcessWatcher 3.0 ƒ / pwsuite.h < prev    next >
Text File  |  1996-04-28  |  5KB  |  187 lines

  1. // pwsuite.h - ProcessWatcher AppleEvents Suite
  2. // (c) H. Marty 1995
  3.  
  4. #ifndef _H_pwsuite
  5. #define _H_pwsuite
  6.  
  7. #ifndef rez
  8. #include <Processes.h>
  9.  
  10. //*******************************************************************
  11.  
  12. struct ProcessListRec {
  13.   ProcessSerialNumber psn;
  14.   Str31 name;
  15. };
  16.  
  17. #endif /* rez */
  18.  
  19. //*******************************************************************
  20. // PW signature
  21.  
  22. #define kPWSignature 'YgzP'
  23. #define kPWSuite kPWSignature
  24.  
  25. // Event Class
  26.  
  27. #define kAEPWEventClass kPWSignature
  28.  
  29. // Events
  30.  
  31. #define kAEPWGetProcessList 'glis'
  32. #define kAEPWListProcesses 'lpro'
  33. #define kAEPWGetProcessInfo 'ginf'
  34. #define kAEPWKill 'kill'
  35. #define kAEPWBringToFront 'fron'
  36. #define kAEPWConnect 'conp'
  37.  
  38. #define keyPWTargetProcess 'prtg' // typeProcessSerialNumber
  39.  
  40. #define typePWProcessList 'plis'
  41. /*
  42.     typePWProcessList defines an array of ProcessListRec :
  43.  
  44.     typedef struct {
  45.         ProcessSerialNumber    psn;        // Process serial number
  46.         Str31                name;        // Pascal string (process name)
  47.     } ProcessListRec;
  48.  
  49.     The number of processes is given by deviding the data size by
  50.     sizeof(ProcessListRec).
  51.     Be very careful that desk accessories names begin with the NULL
  52.     character, so there may be some problems converting process names
  53.     to C strings.
  54.  */
  55. #define typePWProcessInfo    'pinf'
  56. /*
  57.     typePWProcessInfo defines a ProcessInfoRec record
  58.     size: sizeof(ProcessInfoRec)
  59.     "bug": the processName and processAppSpec field are set to nil,
  60.     but you should already know the name from the get process list
  61.     Apple Event.
  62.     Note: the launch date of the ProcessInfoRec is in fact the real date
  63.     and time when the process was launched, and not the number of ticks elapsed
  64.     between boot and launch.
  65.  */
  66.  
  67. /*
  68. ********************************************************************************
  69. Get processes list
  70. ==================
  71.  
  72. Event Class            kAEPWEventClass
  73. Event ID            kAEPWGetProcessList
  74.  
  75. Parameters
  76. ----------
  77. None
  78.  
  79. Reply parameters
  80. ----------------
  81. keyAEResult            An array of structures giving process serial numbers
  82.                     and name of all processes running on the machine.
  83.                     
  84.                     Descriptor type            typePWProcessList
  85.                     Required
  86.                     Size                    multiple of sizeof(ProcessListRec)
  87.  
  88. keyErrorNumber        The result code for the event
  89.                     Descriptor type            typeLongInteger
  90.                     Optional (the abscence of parameter means no error happened)
  91.                     Size                    4 bytes
  92. ********************************************************************************
  93. List processes
  94. ==============
  95.  
  96. Event Class            kAEPWEventClass
  97. Event ID            kAEPWListProcesses
  98.  
  99. Parameters
  100. ----------
  101. None
  102.  
  103. Reply parameters
  104. ----------------
  105. keyAEResult            An list of processes names.
  106.                     
  107.                     Descriptor type            typeList
  108.                     Required
  109.  
  110. keyErrorNumber        The result code for the event
  111.                     Descriptor type            typeLongInteger
  112.                     Optional (the abscence of parameter means no error happened)
  113.                     Size                    4 bytes
  114. ********************************************************************************
  115. Get process info
  116. ================
  117.  
  118. Event Class            kAEPWEventClass
  119. Event ID            kAEPWGetProcessInfo
  120.  
  121. Parameters
  122. ----------
  123. keyDirectObject        The process for which information is desired.
  124.  
  125.                     Descriptor type            typeProcessSerialNumber
  126.                     Required
  127.                     Size                    sizeof(ProcessSerialNumber)
  128.  
  129. Reply parameters
  130. ----------------
  131. keyAEResult            A ProcessInfoRec giving the process information.
  132.                     
  133.                     Descriptor type            typePWProcessInfo
  134.                     Required
  135.                     Size                    sizeof(ProcessInfoRec)
  136.  
  137. keyErrorNumber        The result code for the event
  138.                     Descriptor type            typeLongInteger
  139.                     Optional (the abscence of parameter means no error happened)
  140.                     Size                    4 bytes
  141. ********************************************************************************
  142. Kill process
  143. ============
  144.  
  145. Event Class            kAEPWEventClass
  146. Event ID            kAEPWKill
  147.  
  148. Parameters
  149. ----------
  150. keyDirectObject        The process to be killed.
  151.  
  152.                     Descriptor type            typeProcessSerialNumber
  153.                     Required
  154.                     Size                    sizeof(ProcessSerialNumber)
  155.  
  156. Reply parameters
  157. ----------------
  158. keyErrorNumber        The result code for the event
  159.                     Descriptor type            typeLongInteger
  160.                     Optional (the abscence of parameter means no error happened)
  161.                     Size                    4 bytes
  162. ********************************************************************************
  163. Bring process to front
  164. ======================
  165.  
  166. Event Class            kAEPWEventClass
  167. Event ID            kAEPWBringToFront
  168.  
  169. Parameters
  170. ----------
  171. keyDirectObject        The process to be brought to front.
  172.  
  173.                     Descriptor type            typeProcessSerialNumber
  174.                     Required
  175.                     Size                    sizeof(ProcessSerialNumber)
  176.  
  177. Reply parameters
  178. ----------------
  179. keyErrorNumber        The result code for the event
  180.                     Descriptor type            typeLongInteger
  181.                     Optional (the abscence of parameter means no error happened)
  182.                     Size                    4 bytes
  183. */
  184.  
  185. #endif
  186.  
  187.